package com.lswms.modules.lswms.dao.base;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.lswms.common.dao.BaseDao;
import com.lswms.modules.lswms.entity.base.JianceEntity;
import com.lswms.modules.lswms.entity.stock.InventoryEntity;
import org.apache.ibatis.annotations.*;

import java.util.List;
import java.util.Map;

/**
 * 货物检测
 *
 * @author DX sunlightcs@gmail.com
 * @since 1.0.0 2021-12-30
 */
@Mapper
public interface JianceDao extends BaseDao<InventoryEntity> {
//---------------------弃用---------------------------
    //查询
    @Select("Select * from lswms_lot " +
            "where lot = (" +
            "select lot from lswms_inventory ${ew.customSqlSegment}" +
            ")")
     List<Map<String,Object>> detectionSelect(@Param(Constants.WRAPPER)QueryWrapper<InventoryEntity> wrapper);

    //新增
    @Insert("insert into lswms_lot (sku,lot3,lot4,lot7,adduser,addtime,updatuser,updatetime,lot15)" +
            "values(#{sku},#{lot3},#{lot4},#{lot7},#{adduser},getdate(),#{updatuser},getdate(),'检测')")
    void detectionInsert(Map<String,Object> lotvalue);

    //修改
    @Update("update lswms_inventory set lot = #{lot} where id = #{id}")
    void detectionUpdate(String lot,String id);


}